package org.bee.secuirty.context;


import org.bee.secuirty.model.UserInfo;

public class CurrentUser {
    private static final ThreadLocal<UserInfo> USER_THREAD_LOCAL = new ThreadLocal<>();

    public static void setUser(UserInfo user) {
        USER_THREAD_LOCAL.set(user);
    }

    public static UserInfo getUser() {
        return USER_THREAD_LOCAL.get();
    }

    public static void clearUser() {
        USER_THREAD_LOCAL.remove();
    }
}